// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__9D20E815_7548_41CA_8975_1D7494FA6E6A__INCLUDED_)
#define AFX_STDAFX_H__9D20E815_7548_41CA_8975_1D7494FA6E6A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT

//matlab engin
#define  NO_ADV_GPU 0
#define  Release_FOLDER 0
#define  AUTO_LOAD_DOC 1
#pragma  warning(disable : 4503)
#pragma  warning(disable : 4819)
#include "Global\GlobalFunc.h"

// OpenGL
#include "GLAddon\GLee.h"
#include <GL/gl.h>				
#include <GL/glu.h>			
#include <GL/glut.h>				

///common used head files
#include <iostream>
#include <fstream>
#include <assert.h>
#include <time.h>


#define Pi		3.14159265358979323846
#define Pi_2    6.28318530717958647692
#define Pi_2_DG 180
#define	EPS_6	1e-6			// zero error

#define SAFEDELETE(p)   {if(p) {delete  p; p=NULL;}}
#define SAFEDELETES(p)  {if(p){delete[] p;p=NULL;}}
#define ShowValue(name, value)		{	std::cout<<name<<"\t:\t"<<value<<"\n";	}
#define ShowVector2(name , v2)		{	std::cout<<name<<"\t:\t["<<v2.x<<",\t"<<v2.y<<"]\n";	}
#define ShowVector3(name , v3)		{	std::cout<<name<<"\t:\t["<<v3.x<<",\t"<<v3.y<<",\t"<<v3.z<<"]\n";	}
#define AssertRange(r, upper, lower) {	assert(r>=upper && r<=lower);	}
#define CLIP(x,a,b) __min(__max((x),a),b)
#define Set3Array(x,a,b,c)		{x[0]=a;x[1]=b;x[2]=c;}
#define Set4Array(x,a,b,c,d)	{x[0]=a;x[1]=b;x[2]=c;x[3]=d;}

#define SetLightParamsV(L,ambt,difu,spec, shns)\
{	glLightfv(L,GL_AMBIENT,ambt);	\
	glLightfv(L,GL_DIFFUSE,difu);	\
	glLightfv(L,GL_SPECULAR,spec);	\
	glLightf(L,GL_SHININESS,shns);}	\

#define SetMaterialParamsV(F,ambt,difu,spec,emis)\
{	glMaterialfv(F,GL_AMBIENT,ambt);	\
	glMaterialfv(F,GL_DIFFUSE,difu);	\
	glMaterialfv(F,GL_SPECULAR,spec);	\
	glMaterialfv(F,GL_EMISSION,emis);}	\

#define GetMaterialParamsV(F,ambt,difu,spec,emis)\
{	glGetMaterialfv(F,GL_AMBIENT,ambt);		\
	glGetMaterialfv(F,GL_DIFFUSE,difu);		\
	glGetMaterialfv(F,GL_SPECULAR,spec);	\
	glGetMaterialfv(F,GL_EMISSION,emis);}	\

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.


#ifdef _UNICODE
#if defined _M_IX86
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_IA64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#elif defined _M_X64
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
#else
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#endif
#endif





#endif // !defined(AFX_STDAFX_H__9D20E815_7548_41CA_8975_1D7494FA6E6A__INCLUDED_)


